home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Development / PartMaker / Container•1.0d11v2 / Container•1.0d11v2.rsrc / dFRK_5080 < prev    next >
Encoding:
Text File  |  1995-12-08  |  5.7 KB  |  169 lines

  1. //========================================================================================
  2. //
  3. //    File:                ContainerFrm.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef CONTAINERFRM_H
  13. #define CONTAINERFRM_H
  14.  
  15. // ----- Part Layer -----
  16.  
  17. #ifndef FWFRMING_H
  18. #include "FWFrming.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Forward Declaration
  23. //========================================================================================
  24.  
  25. #if FW_LIB_EXPORT_PRAGMAS
  26. #pragma import on
  27. #endif
  28. class FW_CLASS_ATTR FW_CPresentation;
  29. class FW_CLASS_ATTR FW_CGrowBox;
  30. #if FW_LIB_EXPORT_PRAGMAS
  31. #pragma import off
  32. #endif
  33.  
  34. class FW_CLASS_ATTR CContainerPart;
  35. class FW_CLASS_ATTR CContainerSelection;
  36. class FW_CLASS_ATTR FW_CRuler;
  37.  
  38. //========================================================================================
  39. // CContainerFrame
  40. //========================================================================================
  41.  
  42. class FW_CLASS_ATTR CContainerFrame : public FW_CEmbeddingFrame
  43. {
  44. public:
  45.     FW_DECLARE_CLASS
  46.  
  47. //----------------------------------------------------------------------------------------
  48. // Initialization/destruction
  49. //
  50. public:        
  51.     CContainerFrame(Environment *ev, ODFrame* odFrame, FW_CPresentation* presentation, CContainerPart* containerPart);
  52.     virtual ~ CContainerFrame();
  53.  
  54. //----------------------------------------------------------------------------------------
  55. // Inherited API
  56. //
  57. public:        
  58.     // ----- Menu
  59.     virtual FW_Boolean        DoAdjustMenus(Environment *ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  60.     virtual FW_Boolean        DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  61.     
  62.     // ----- Events -----
  63.     virtual FW_Boolean        DoActivateEvent(Environment* ev, const FW_CActivateEvent& theActivateEvent);
  64.  
  65.     // ----- Embedding -----
  66.     virtual void            EmbedSingleFrame(Environment* ev, 
  67.                                             ODPart* odPart, 
  68.                                             ODFrame* odEmbeddedFrame, 
  69.                                             ODShape* frameShape);
  70.  
  71.     virtual ODFacet*        CreateEmbeddedFacet(Environment* ev,
  72.                                             ODFacet* embeddingFacet,
  73.                                             FW_MProxy* proxy,
  74.                                             ODFrame* embeddedFrame,
  75.                                             ODShape* proposedClipShape);
  76.     
  77.     // ----- Geometry -----                                    
  78.     virtual void            GeometryChanged(Environment *ev,
  79.                                             ODFacet* odFacet,
  80.                                             FW_Boolean clipShapeChanged,
  81.                                             FW_Boolean externalTransformChanged);
  82.     virtual void            FrameShapeChanged(Environment *ev);
  83.                                             
  84.     // ----- Window Size ------
  85.     virtual void            AdjustZoomedWindowSize(Environment* ev, FW_CPoint& proposedSize);
  86.     virtual void            AdjustWindowGrowLimits(Environment* ev, FW_CPoint& minSize, FW_CPoint& maxSize);
  87.     
  88.     // ----- Gadget Layout -----
  89.     virtual void                CreateSubViews(Environment* ev);
  90.     virtual void                AdjustSubViews(Environment* ev);
  91.  
  92.     // ----- Commands -----
  93.     virtual FW_CEditCommand*     NewEditCommand(Environment *ev, ODCommandID commandID);
  94.     virtual FW_CDragCommand*     NewDragCommand(Environment *ev, FW_CFrame* theFrame);
  95.     virtual FW_CDropCommand*    NewDropCommand(Environment *ev, FW_CFrame* frame,
  96.                                                 ODDragItemIterator* dropInfo, 
  97.                                                 ODFacet* facet, const FW_CPoint& windowPoint);
  98.                                                 
  99.     // ----- Printing ------
  100.     virtual FW_CPrintHandler*    NewPrintHandler(Environment* ev);
  101.     virtual    FW_Boolean            IsCurrentlyPrintable(Environment* ev) const;
  102.     virtual void                GetPrintContentExtent(Environment *ev, FW_CPoint& extent) const;
  103.  
  104.     // ----- Containering ------
  105.     virtual void                 Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  106.  
  107.     // ----- Miscellaneous -----
  108.     virtual void                FacetAdded(Environment* ev, ODFacet* facet);
  109.  
  110.     virtual FW_Boolean            RevealFrame(Environment *ev, 
  111.                                         ODFrame* embeddedFrame, 
  112.                                         ODShape* revealShape);
  113.  
  114.     // ----- Internalize/Externalize -----
  115.     virtual void            ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  116.     virtual void            InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  117.     
  118. //----------------------------------------------------------------------------------------
  119. //    New API
  120. //
  121. public:
  122.     ODShape*                AcquireContentShape(Environment *ev, ODShape* invalidShape);
  123.     CContainerSelection*            GetSelection(Environment *ev);
  124.     void                    ToggleRulers(Environment *ev, FW_Boolean visible);
  125.  
  126.     FW_Boolean                IsGraphicsGridOn() const;
  127.     FW_Boolean                AreRulersOn() const;
  128.     
  129. //----------------------------------------------------------------------------------------
  130. // Data Members
  131. //
  132. private:    
  133.     CContainerPart*                fContainerPart;
  134.     FW_CGrowBox*            fGrowBox;
  135.     CContainerSelection*            fSelection;
  136.     
  137.     FW_CRuler*                fHorzRuler;
  138.     FW_CRuler*                fVertRuler;
  139.     
  140.     FW_Boolean                fGridShown;
  141.     FW_Boolean                fRulersShown;
  142. };
  143.  
  144. //----------------------------------------------------------------------------------------
  145. //    CContainerFrame::GetSelection
  146. //----------------------------------------------------------------------------------------
  147. inline CContainerSelection*    CContainerFrame::GetSelection(Environment *ev)
  148. {
  149.     return fSelection;
  150. }
  151.  
  152. //----------------------------------------------------------------------------------------
  153. //    CContainerFrame::IsGraphicsGridOn
  154. //----------------------------------------------------------------------------------------
  155. inline FW_Boolean CContainerFrame::IsGraphicsGridOn() const
  156. {
  157.     return fGridShown;
  158. }
  159.  
  160. //----------------------------------------------------------------------------------------
  161. //    CContainerFrame::AreRulersOn
  162. //----------------------------------------------------------------------------------------
  163. inline FW_Boolean CContainerFrame::AreRulersOn() const
  164. {
  165.     return fRulersShown;
  166. }
  167.  
  168. #endif
  169.